import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooMinishopSkuController } from '../../../controllers';
const uctoominishopSkuRouter = new Router();
const minishopSkuController = new uctooMinishopSkuController();

uctoominishopSkuRouter.post('/add', requireUser, minishopSkuController.add);
uctoominishopSkuRouter.post('/edit', requireUser, rowLevelPermission('uctoo/minishop_sku'), minishopSkuController.edit);
uctoominishopSkuRouter.post('/del', requireUser, rowLevelPermission('uctoo/minishop_sku'), minishopSkuController.delete);

//For getting minishopSku with permission control
uctoominishopSkuRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/minishop_sku'), minishopSkuController.getSingle);
uctoominishopSkuRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/minishop_sku'), minishopSkuController.getMany);
uctoominishopSkuRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/minishop_sku'), minishopSkuController.getMany);

//#endregion AutoCreateCode
export default uctoominishopSkuRouter;
